<!DOCTYPE html>
<html lang="en" xmlns:th="https://www.thymeleaf.org">
<head>
	<meta charset="utf-8">
	<title>HTML注册登录页面模板</title>
	<link rel="stylesheet" href="/lr/css/style.css">
	<script th:src="@{/assets/jquery/jquery-3.5.1.min.js}"></script>
	<script th:src="@{/assets/layer/layer.js}"></script>
	<script th:src="@{/customize/js/c-ui.js}"></script>
</head>

<body>
<div class="content">
	<div class="form sign-in">
		<h2>欢迎回来</h2>
		<form method="post" th:action="@{login}">
			<label>
				<span>账号</span>
				<input type="text" name="loginName" />
			</label>
			<label>
				<span>密码</span>
				<input type="password" name="password" />
			</label>
			<button type="button" class="submit">登 录</button>
		</form>
	</div>
	<div class="sub-cont">
		<div class="img">
			<div class="img__text m--up">
				<h2>还未注册？</h2>
				<p>立即注册，发现大量机会！</p>
			</div>
			<div class="img__text m--in">
				<h2>已有帐号？</h2>
				<p>有帐号就登录吧，好久不见了！</p>
			</div>
			<div class="img__btn">
				<span class="m--up">注 册</span>
				<span class="m--in">登 录</span>
			</div>
		</div>
		<div class="form sign-up">
			<h2>立即注册</h2>
			<form method="post" id="register" th:action="@{/user/new}">
				<label>
					<span>账号</span>
					<input type="text" name="loginName" />
				</label>
				<label>
					<span>用户名</span>
					<input type="text" name="name" />
				</label>
				<label>
					<span>手机号</span>
					<input type="text" name="phone"/>
				</label>
				<label>
					<span>密码</span>
					<input type="password" name="password" />
				</label>
				<button type="button" onclick="register()" class="submit">注 册</button>
			</form>
		</div>
	</div>
</div>
<script>
	/*注册*/
	function register() {
		$.ajax({
			type: "POST",
			url: $('#register').attr('action'),
			data: $('#register').serialize(),
			success: function (result) {
				layer.alert(result.msg)
			}
		});
	}
</script>
<script src="lr/js/script.js"></script>
</body>

</html>
